//
//  HYLevelViewController.m
//  HaiYue
//
//  Created by skyline on 2018/6/15.
//  Copyright © 2018年 skyline. All rights reserved.
//

#import "HYLevelViewController.h"
#import "HYVIPCharts.h"
@interface HYLevelViewController ()
{
    NSArray *_array;
}
@property (nonatomic, strong) HYImageView *chartIMG;
@end

@implementation HYLevelViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"VIP等级规则";
  _array = @[@{@"VIP1":@{@"discount":@"9.8",@"content":@"注册成功即可"}},
                       @{@"VIP2":@{@"discount":@"9.8",@"content":@""}},
                       @{@"VIP3":@{@"discount":@"9.6",@"content":@"通过推广链接注册"}},
                       @{@"VIP4":@{@"discount":@"9.4",@"content":@"vip1,vip3充值6元即可"}},
                       @{@"VIP5":@{@"discount":@"9.2",@"content":@"200"}},
                       @{@"VIP6":@{@"discount":@"9.0",@"content":@"500"}},
                       @{@"VIP7":@{@"discount":@"8.8",@"content":@"1000"}},
                       @{@"VIP8":@{@"discount":@"8.6",@"content":@"2500"}},
                       @{@"VIP9":@{@"discount":@"8.4",@"content":@"5000"}},
                       @{@"VIP10":@{@"discount":@"8.2",@"content":@"10000"}},
                       @{@"VIP11":@{@"discount":@"8.0",@"content":@"20000"}},
                       @{@"VIP12":@{@"discount":@"7.8",@"content":@"40000"}},
                       @{@"VIP13":@{@"discount":@"7.6",@"content":@"60000"}},
                       @{@"VIP14":@{@"discount":@"7.4",@"content":@"80000"}},
                       @{@"VIP15":@{@"discount":@"7.2",@"content":@"100000"}}];
    // Do any additional setup after loading the view.
}

- (HYImageView *)chartIMG
{
    if (!_chartIMG)
    {
       _chartIMG = [[HYImageView alloc] initWithImage:[HYVIPCharts chartsWithArray:_array]];
        [self.scrollView setContentSize:_chartIMG.image.size];
        self.scrollView.pagingEnabled = NO;
        self.scrollView.showsVerticalScrollIndicator = NO;
        [self.scrollView addSubview:_chartIMG];
        
        [_chartIMG mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_offset(UIEdgeInsetsMake(0, 0, 2 *GAP, 0));
        }];
    }
    return _chartIMG;
}


- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.style = HYViewNaviBarStyleOnlyLeftBtn;
    self.chartIMG.hidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
